<?php


namespace Frontend\Controllers;


class TestController extends BaseController
{
    public function beforeExecuteRoute($dispatcher)
    {
        parent::beforeExecuteRoute($dispatcher);

    }

    public function AlipayAction()
    {
        $sign = 'pWWtDMx1YnhCptmQ6qd9ZmA6L6q2gr+RBLYvlclkQ6K7qF1rphB8QgCiEQ0KOzXk2Gt2juwg7j6SIiTTWs+vAcdid+5qivxQD6zqVQoXcClpUMgdKaNnAUV5uB6Opj0tbYUMoB9G93VRGvgDnZC/H3Gyra5jZ5JBDJmGNvGF+CY=';
        $biz_content = '<?xml version="1.0" encoding="gbk"?><XML><AppId><![CDATA[2014121300019751]]></AppId><FromUserId></FromUserId><CreateTime><![CDATA[1425028711657]]></CreateTime><MsgType><![CDATA[event]]></MsgType><EventType><![CDATA[verifygw]]></EventType><ActionParam></ActionParam><AgreementId></AgreementId><AccountNo></AccountNo></XML>';
        $sign_type = 'RSA';
        $charset = 'GBK';
        $service = 'alipay.service.check';

        $service='alipay.mobile.public.message.notify';
        $biz_content='<XML><Text><Content><![CDATA[hlj]]></Content></Text><AppId><![CDATA[2014121300019751]]></AppId><MsgType><![CDATA[text]]></MsgType><CreateTime><![CDATA[1425029704873]]></CreateTime><FromUserId><![CDATA[JBtNUsLBDRKUrQZk4I4V+-mqyQuEmUObpyq9OLPD3iprf92Lk2sgglVUx96pJomo01]]></FromUserId><MsgId><![CDATA[150227473504000001]]></MsgId><UserInfo><![CDATA[{"logon_id":"bub***@163.com","user_name":"*Դ"}]]></UserInfo></XML>';
        $sign='gX+/0j2qDs/D12KJjMW7eS7kAi0VDeBKhH4Dp9+6+zbDygUqy7Ro6TZjMwAKgUtPoByEnbaykETgLUlsuI4iXmdPssh2FqdfdLsQ0hyQKwPm7eTbr/gHl+kgeUWgV6XJTRDGJ2aTr3pzdSFwaKC+Axrewfpi6I8r9xh4P+SdekU=';

        $params = array(
            'sign' => $sign,
            'biz_content' => $biz_content,
            'sign_type' => $sign_type,
            'charset' => $charset,
            'service' => $service
        );
        $ch = curl_init();
        $url = 'http://sydev.1yizu.com/frontend/alipay';

        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
        $output = curl_exec($ch);
        curl_close($ch);
        echo $output;
    }


}